import org.hibernate.FetchMode

class ProductService {

    boolean transactional = false

    def findRoots() {
        def c = ProductCategory.createCriteria()
        def productCategoryInstanceList = c.listDistinct {
            isNull('parent')
            fetchMode("children", FetchMode.EAGER)
            fetchMode("products", FetchMode.EAGER)
        }
        return productCategoryInstanceList

    }
}
